package GearCommands;

import Connections.Peer;
import Gear.Gear;

/**
 * Implementation of the user command lspeers.
 * List all peers connected to a gear server.
 *
 * @author Davi Mendes
 */
public class GearCommandLsPeers implements GearCommand {

    @Override
    public void execute(String[] args, Gear gear) {
        try {
            if (args.length > 1) throw new IllegalArgumentException("Too much arguments to startaspeer command.");

            Peer.getInstance().lsPeers();


        } catch (IllegalArgumentException ex) {
            System.out.println(ex.getMessage());
        }
    }

}
